package com.xxh.dataaccess.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xxh.dataaccess.dao.FriendDao;
import com.xxh.dataaccess.entity.Friend;
import com.xxh.dataaccess.service.FriendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("FriendService")
public class FriendServiceImpl extends ServiceImpl<FriendDao, Friend> implements FriendService {

    @Autowired
    FriendDao friendDao;


    @Override
    public List<Integer> getFriendID(Integer uid) {
        return friendDao.getFrinedID(uid);
    }

    //是否为我当前好友
    @Override
    public boolean isFriend(Integer uid, Integer fid) {
        List<Integer> fids = friendDao.getFrinedID(uid);
        if (fids.contains(fid)) {
            return true;
        } else {
            return false;
        }
    }

}
